import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import test03 from '@/components/test03'
import videoPlayer from '@/components/videoPlayer'
import zhibo from '@/components/zhibo'
import testdmu from '@/components/testdmu'
import testgundong from '@/components/testgundong'
import testgundong01 from '@/components/testgundong01'
import zhibohome from '@/components/zhibohome'
import cctv from '@/components/cctv'
import fenlei from '@/components/fenlei'
import shujufenxi from '@/components/shujufenxi'
import search from "../components/search";
import showzhubo from "../components/showzhubo";
import showlive from "../components/showlive";
import showvideo from "../components/showvideo";
import showmultiple from "../components/showmultiple";
import shownote from "../components/shownote";
import login from "../components/login";
import register from "../components/register";
import recharge from "../components/recharge";
import personal from "../components/personal";
import paymentSuccess from "../components/paymentSuccess";
import top from '@/components/top'
import videos from '@/components/videos'
import fisheight from '@/components/fisheight'
import talk from '@/components/talk'
import main from '@/components/main'
import like from '@/components/like'
import favor from '@/components/favor'
import hotwbs from '@/components/hotwbs'
import homeRank from '@/components/homeRank'
import hotanchor from '@/components/hotanchor'
import game from '@/components/game'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/test03',
      name: 'test03',
      component: test03
    },
    {
      path: '/videoPlayer',
      name: 'videoPlayer',
      component: videoPlayer
    },
    {
      path: '/zhibo',
      name: 'zhibo',
      component: zhibo
    },
    {
      path: '/testdmu',
      name: 'testdmu',
      component: testdmu
    },
    {
      path: '/testgundong',
      name: 'testgundong',
      component: testgundong
    },
    {
      path: '/testgundong01',
      name: 'testgundong01',
      component: testgundong01
    },
    {
      path: '/zhibohome',
      name: 'zhibohome',
      component: zhibohome
    },
    {
      path: '/cctv',
      name: 'cctv',
      component: cctv
    }
    , {
      path: '/fenlei',
      name: 'fenlei',
      component: fenlei
    },
    // {
    //   path: '/Echarts',
    //   name: 'Echarts',
    //   component: Echarts
    // },
    {
      path: '/shujufenxi',
      name: 'shujufenxi',
      component: shujufenxi
    },
    {
      path: '/personal',
      name: 'personal',
      component: personal,
    },

    {
      path: '/recharge',
      name: 'recharge',
      component: recharge,
    },
    {
      path: '/paymentSuccess',
      name: 'paymentSuccess',
      component: paymentSuccess,
    },
    {
      path: '/register',
      name: 'register',
      component: register,
    },
    {
      path: '/login',
      name: 'login',
      component: login,
    },
    ,
    {
      path: '/videos',
      name: 'videos',
      component: videos
    },
    {
      path: '/top',
      name: 'top',
      component: top

    },
    {
      path: '/search',
      name: 'search',
      component: search,
      children:[{
        path: '/showzhubo',
        name: 'showzhubo',
        component: showzhubo,

      },
        {
          path: '/showlive',
          name: 'showlive',
          component: showlive,
        },
        {
          path: '/showvideo',
          name: 'showvideo',
          component: showvideo,
        },
        {
          path: "/showmultiple",
          name: 'showmultiple',
          component: showmultiple,
        },
        {
          path: "/shownote",
          name: 'shownote',
          component: shownote,
        },
      ]
    },
    {
      path: '/fisheight',
      name: 'fisheight',
      component: fisheight,
      children:[
        {
          path: '/main',
          name: 'main',
          component: main
        },
        {
          path: '/like',
          name: 'like',
          component: like
        },
        {
          path: '/favor',
          name: 'favor',
          component: favor
        },
        {
          path: '/hotwbs',
          name: 'hotwbs',
          component: hotwbs
        },
      ]
    },
    {
      path: '/talk',
      name: 'talk',
      component: talk
    },
    {
      path: '/homeRank',
      name: 'homeRank',
      component: homeRank,
      children: [
        {
          path: '/hotanchor',
          name: 'hotanchor',
          component: hotanchor
        },
        {
          path: '/game',
          name: 'game',
          component: game
        },
      ]
    }
  ],
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return {
        x: 0,
        y: 0
      }
    }
  }
})
